<template>
  <div class="lsit">
    <el-row>
      <el-col :span="24">
        <el-input placeholder="请输入内容" class="search-input"></el-input>
        <CateSelect></CateSelect>
        <el-button type="primary">搜索</el-button>

        <el-button type="primary" @click="$router.push('/goods/add')">添加</el-button>
      </el-col>
    </el-row>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="id" label="序号" width="180">
        <template slot-scope="{row,$index}">
          {{ $index + 1 }}
        </template>
      </el-table-column>
      <el-table-column prop="name" label="姓名" width="180">
      </el-table-column>
      <el-table-column prop="address" label="地址">
      </el-table-column>
      <el-table-column fixed="right" label="操作" width="100">
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
          <el-button type="text" size="small">编辑</el-button>
        </template>
      </el-table-column>

    </el-table>
    <el-pagination
      :page-sizes="[100, 200, 300, 400]" :page-size="2" layout="sizes, prev, pager, next" :total="1000" class="list-page">
    </el-pagination>
  </div>
</template>

<script>
  import CateSelect from './components/CateSelect.vue'
  export default {
    name: "goodsList",
    components:{
      CateSelect
    },
    props: [],
    data() {
      return {

        tableData: [{
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄'
        }, {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1519 弄'
        }, {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1516 弄'
        }],

    };

  }
  }
</script>

<style lang="scss">
  .el-row {
    margin-bottom: 20px;

    &:last-child {
      margin-bottom: 0;
    }
  }

  .el-col {
    border-radius: 4px;
  }



  .bg-purple {
    background: #d3dce6;
  }

  .bg-purple-light {
    background: #e5e9f2;
  }

  .grid-content {
    border-radius: 4px;
    min-height: 36px;
  }

  .row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
  }

  .lsit {
    padding: 20px;
    box-sizing: border-box;

    .search-input {
      width: 150px;
    }

    .list-page {
      margin-top: 20px;
    }
  }
</style>
